.class public Lcom/kwad/sdk/core/page/widget/b;
.super Landroid/widget/ImageView;


# instance fields
.field private a:Landroid/graphics/Path;

.field private b:I

.field private c:I

.field private d:I

.field private e:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Lcom/kwad/sdk/core/page/widget/b;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/kwad/sdk/core/page/widget/b;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0

    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    new-instance p1, Landroid/graphics/Path;

    invoke-direct {p1}, Landroid/graphics/Path;-><init>()V

    iput-object p1, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    return-void
.end method


# virtual methods
.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 7

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "leftTopRadius:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v1, p0, Lcom/kwad/sdk/core/page/widget/b;->b:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "test.chen"

    invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget v0, p0, Lcom/kwad/sdk/core/page/widget/b;->b:I

    if-nez v0, :cond_0

    iget v0, p0, Lcom/kwad/sdk/core/page/widget/b;->e:I

    if-nez v0, :cond_0

    iget v0, p0, Lcom/kwad/sdk/core/page/widget/b;->c:I

    if-nez v0, :cond_0

    iget v0, p0, Lcom/kwad/sdk/core/page/widget/b;->d:I

    if-nez v0, :cond_0

    invoke-super {p0, p1}, Landroid/widget/ImageView;->onDraw(Landroid/graphics/Canvas;)V

    return-void

    :cond_0
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x12

    if-ge v0, v1, :cond_1

    const/4 v0, 0x1

    const/4 v1, 0x0

    invoke-virtual {p0, v0, v1}, Landroid/widget/ImageView;->setLayerType(ILandroid/graphics/Paint;)V

    :cond_1
    invoke-virtual {p0}, Landroid/widget/ImageView;->getMeasuredWidth()I

    move-result v0

    invoke-virtual {p0}, Landroid/widget/ImageView;->getMeasuredHeight()I

    move-result v1

    iget v2, p0, Lcom/kwad/sdk/core/page/widget/b;->b:I

    iget v3, p0, Lcom/kwad/sdk/core/page/widget/b;->e:I

    invoke-static {v2, v3}, Ljava/lang/Math;->max(II)I

    move-result v2

    iget v3, p0, Lcom/kwad/sdk/core/page/widget/b;->c:I

    iget v4, p0, Lcom/kwad/sdk/core/page/widget/b;->d:I

    invoke-static {v3, v4}, Ljava/lang/Math;->max(II)I

    move-result v3

    add-int/2addr v2, v3

    iget v3, p0, Lcom/kwad/sdk/core/page/widget/b;->b:I

    iget v4, p0, Lcom/kwad/sdk/core/page/widget/b;->c:I

    invoke-static {v3, v4}, Ljava/lang/Math;->max(II)I

    move-result v3

    iget v4, p0, Lcom/kwad/sdk/core/page/widget/b;->e:I

    iget v5, p0, Lcom/kwad/sdk/core/page/widget/b;->d:I

    invoke-static {v4, v5}, Ljava/lang/Math;->max(II)I

    move-result v4

    add-int/2addr v3, v4

    if-lt v0, v2, :cond_2

    if-le v1, v3, :cond_2

    iget-object v2, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    invoke-virtual {v2}, Landroid/graphics/Path;->reset()V

    iget-object v2, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    iget v3, p0, Lcom/kwad/sdk/core/page/widget/b;->b:I

    int-to-float v3, v3

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Landroid/graphics/Path;->moveTo(FF)V

    iget-object v2, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    iget v3, p0, Lcom/kwad/sdk/core/page/widget/b;->c:I

    sub-int v3, v0, v3

    int-to-float v3, v3

    invoke-virtual {v2, v3, v4}, Landroid/graphics/Path;->lineTo(FF)V

    iget-object v2, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    int-to-float v3, v0

    iget v5, p0, Lcom/kwad/sdk/core/page/widget/b;->c:I

    int-to-float v5, v5

    invoke-virtual {v2, v3, v4, v3, v5}, Landroid/graphics/Path;->quadTo(FFFF)V

    iget-object v2, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    iget v5, p0, Lcom/kwad/sdk/core/page/widget/b;->d:I

    sub-int v5, v1, v5

    int-to-float v5, v5

    invoke-virtual {v2, v3, v5}, Landroid/graphics/Path;->lineTo(FF)V

    iget-object v2, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    int-to-float v5, v1

    iget v6, p0, Lcom/kwad/sdk/core/page/widget/b;->d:I

    sub-int/2addr v0, v6

    int-to-float v0, v0

    invoke-virtual {v2, v3, v5, v0, v5}, Landroid/graphics/Path;->quadTo(FFFF)V

    iget-object v0, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    iget v2, p0, Lcom/kwad/sdk/core/page/widget/b;->e:I

    int-to-float v2, v2

    invoke-virtual {v0, v2, v5}, Landroid/graphics/Path;->lineTo(FF)V

    iget-object v0, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    iget v2, p0, Lcom/kwad/sdk/core/page/widget/b;->e:I

    sub-int/2addr v1, v2

    int-to-float v1, v1

    invoke-virtual {v0, v4, v5, v4, v1}, Landroid/graphics/Path;->quadTo(FFFF)V

    iget-object v0, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    iget v1, p0, Lcom/kwad/sdk/core/page/widget/b;->b:I

    int-to-float v1, v1

    invoke-virtual {v0, v4, v1}, Landroid/graphics/Path;->lineTo(FF)V

    iget-object v0, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    iget v1, p0, Lcom/kwad/sdk/core/page/widget/b;->b:I

    int-to-float v1, v1

    invoke-virtual {v0, v4, v4, v1, v4}, Landroid/graphics/Path;->quadTo(FFFF)V

    iget-object v0, p0, Lcom/kwad/sdk/core/page/widget/b;->a:Landroid/graphics/Path;

    invoke-virtual {p1, v0}, Landroid/graphics/Canvas;->clipPath(Landroid/graphics/Path;)Z

    :cond_2
    invoke-super {p0, p1}, Landroid/widget/ImageView;->onDraw(Landroid/graphics/Canvas;)V

    return-void
.end method

.method public setRadius(I)V
    .locals 0

    iput p1, p0, Lcom/kwad/sdk/core/page/widget/b;->b:I

    iput p1, p0, Lcom/kwad/sdk/core/page/widget/b;->e:I

    iput p1, p0, Lcom/kwad/sdk/core/page/widget/b;->c:I

    iput p1, p0, Lcom/kwad/sdk/core/page/widget/b;->d:I

    return-void
.end method
